package com.it.demo;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.quartz.*;

/**
 * quartz示例定时器类
 *
 * @author Administrator
 *
 */
//@DisallowConcurrentExecution
//@PersistJobDataAfterExecution
public class QuartzJobExample implements Job {
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "★★★★★★★★★★★");
        JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
//        String a = jobDataMap.getString("a");
        int a = jobDataMap.getInt("a");
        a++;
        //再存里
        jobDataMap.put("a",a);
        System.out.println(a);
    }
}
